<template>
	<view style="padding: 200rpx 30rpx;">
		<view class="" style="text-align: center;">
			由于微信小程序不支持下载别的平台的文件，请你复制链接到浏览器中打开(每次链接有效期为一个小时)
		</view>
		<view class="" style="display: flex;align-items: center;justify-content: center;">
			<view class="" style="margin-top: 200rpx;width: 200rpx;">
				<uv-button type="success" text="复制链接" @click="copyText"></uv-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: '899' //要打开的外部链接
			}
		},
		onLoad(option) {
			this.url =JSON.parse(decodeURIComponent(option.url))
			console.log(this.url);
		},
		methods: {
			// 点击按钮触发复制事件
			copyText() {
			  var that = this;
			  wx.setClipboardData({
			    data: that.url,
			    success: function(res) {
			      wx.showToast({
			        title: '复制成功',
			        icon: 'success',
			        duration: 2000
			      });
			    },
				fail(err) {
					console.log(err);
				}
			  });
			}
		}
	}
</script>

<style>

</style>